<%= append_stylesheet_pack_tag "decidim_proposals" %>
<%= append_javascript_pack_tag "decidim_proposals" %>

<% content_for :aside do %>
  <h1 class="title-decorator">
    <%= translated_attribute(current_component.name) %>
  </h1>

  <%= render partial: "decidim/proposals/proposals/participatory_texts/view_index" %>
<% end %>

<%= render layout: "layouts/decidim/shared/layout_two_col" do %>

  <%= render partial: "decidim/shared/component_announcement" %>

  <section class="layout-main__section">
    <% if @participatory_text.nil? %>
      <%= cell("decidim/announcement", t("alternative_title", scope: "decidim.proposals.participatory_text_proposal")) %>
    <% else %>
      <h2 class="proposal-participatory__heading">
        <%= translated_attribute(@participatory_text.title) %>
      </h2>
    <% end %>
  </section>

  <section id="proposals" class="layout-main__section">
    <% @proposals.each do |proposal| %>
      <%= cell("decidim/proposals/participatory_text_proposal", proposal, context: { current_user: }) %>
    <% end %>
  </section>

<% end %>
